home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 001-010 / amok06 / iffsupport / demos / copyiff.mod < prev    next >
Text File  |  1993-11-04  |  2KB  |  64 lines

  1. (*---------------------------------------------------------------------------
  2.     :Program.    CopyIFF.mod
  3.     :Author.     Fridtjof Siebert
  4.     :Address.    Nobileweg 67, D-7-Stgt-40
  5.     :Phone.      0711/822509
  6.     :Shortcut.   [fbs]
  7.     :Version.    1.0
  8.     :Date.       27-Jul-88
  9.     :Copyright.  PD
  10.     :Language.   Modula-II
  11.     :Translator. M2Amiga
  12.     :Imports.    IFFSupport [fbs].
  13.     :UpDate.     none.
  14.     :Contents.   Demonstration für IFFSupport. Lädt ein IFF-Bild und
  15.     :Contents.   speichert es gepackt als test.iff ins actuelle Directory.
  16.     :Remark.     Syntax: CopyIFF <filename>
  17. ---------------------------------------------------------------------------*)
  18.  
  19. MODULE CopyIFF;
  20.  
  21. FROM SYSTEM     IMPORT ADR, ADDRESS, SHIFT, BITSET, LONGSET, CAST;
  22.  
  23. FROM Arguments  IMPORT NumArgs,GetArg;
  24.  
  25. FROM Intuition  IMPORT ScreenPtr,CloseScreen,DisplayBeep,WindowPtr;
  26.  
  27. FROM IFFSupport IMPORT ReadILBM,ReadILBMFlags,ReadILBMFlagSet,WriteILBMAll,
  28.                        IFFInfo;
  29.  
  30. VAR
  31.   MyScreen: ScreenPtr;        (* the Picture's ScreenPointer               *)
  32.   WindowDummy: WindowPtr;     (* only a dummy for NIL-Windowpointer        *)
  33.   Name: ARRAY[0..79] OF CHAR; (* the Picture's Name                        *)
  34.   length: INTEGER;            (* dummy for receiving Name's Length         *)
  35.   Ciapra [0BFE001H]: SET OF (s0,s1,s2,s3,s4,s5,lmb);
  36.     (* Ciapra is a Hardware-Register. Bit #6 contains the left Button      *)
  37.  
  38. BEGIN
  39.  
  40. (*------  Get Name:  ------*)
  41.  
  42.   IF NumArgs()#0 THEN
  43.     GetArg(1,Name,length);
  44.   ELSE
  45.     HALT; (* a silly guy didn't say which pic I should load *)
  46.   END;
  47.  
  48. (*------  Read and Save Pic:  ------*)
  49.  
  50.   IF ReadILBM(Name,ReadILBMFlagSet{front,visible},MyScreen,WindowDummy) THEN
  51.  
  52.     IF NOT(WriteILBMAll("RAM:test.iff",ADR(IFFInfo),
  53.                         MyScreen^.rastPort.bitMap,0,0,TRUE)) THEN
  54.       DisplayBeep(NIL);
  55.     END;
  56.  
  57.     CloseScreen(MyScreen); (* close the Screen *)
  58.  
  59.   ELSE
  60.     DisplayBeep(NIL); (* any error occured: lets display a Beep ! *)
  61.   END;
  62.  
  63. END CopyIFF. That's all. Wasn't that easy ???
  64.